package com.sg.controller.bff;

import com.sg.service.biz.bff.PowerService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Power", tags = {"Power"})
@RestController
// @RequestMapping("/oms/power/")
public class PowerController {

    @Autowired
    PowerService powerService;

    /**
     * B-检查权限（公共）
     * gen by moon at 8/10/2022, 3:37:11 AM
     */
    @PostMapping("/oms/power/checkPowerCom")
    @ApiOperation(value = "B-检查权限（公共）", response = OkrResult.class)
    public OkrResult<BffCheckPowerComRespDto> checkPowerCom(@RequestBody(required = false) @Validated BffCheckPowerComReqDto reqDTO) {
        return OkrResult.success(powerService.checkPowerCom(reqDTO));
    }

    /**
     * B1-2新增管理的部门（管理）
     * gen by moon at 8/22/2022, 10:22:53 PM
     */
    @PostMapping("/oms/mgt/power/addManageDept")
    @ApiOperation(value = "B1-2新增管理的部门（管理）", response = OkrResult.class)
    public OkrResult<BffAddManageDeptRespDto> addManageDept(@RequestBody(required = false) @Validated BffAddManageDeptReqDto reqDTO) {
        return OkrResult.success(powerService.addManageDept(reqDTO));
    }

    /**
     * B1-2查询管理的部门列表（管理）
     * gen by moon at 8/10/2022, 3:33:42 AM
     */
    @PostMapping("/oms/mgt/power/queryManageDeptList")
    @ApiOperation(value = "B1-2查询管理的部门列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryManageDeptListRespDto> queryManageDeptList(@RequestBody(required = false) @Validated BffQueryManageDeptListReqDto reqDTO) {
        return OkrResult.success(powerService.queryManageDeptList(reqDTO));
    }

    /**
     * B1-2查询权限分配的角色列表（管理）
     * gen by moon at 8/10/2022, 3:32:38 AM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerRoleList")
    @ApiOperation(value = "B1-2查询权限分配的角色列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerRoleListRespDto> queryTributPowerRoleList(@RequestBody(required = false) @Validated BffQueryTributPowerRoleListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerRoleList(reqDTO));
    }

    /**
     * B1-2查询部门管理权限
     */
    @PostMapping("/oms/mgt/power/queryDeptPowerDetail")
    @ApiOperation(value = "B1-2查询部门管理权限", response = OkrResult.class)
    public OkrResult<BffQueryDeptPowerDetailRespDto> queryDeptPowerDetail(@RequestBody(required = false) @Validated BffQueryDeptPowerDetailReqDto reqDTO) {
        return OkrResult.success(powerService.queryDeptPowerDetail(reqDTO));
    }

    /**
     * B1-存档权限分配（管理）（公共）
     * gen by moon at 8/22/2022, 10:22:55 PM
     */
    @PostMapping("/oms/mgt/power/archiveTributPowerCom")
    @ApiOperation(value = "B1-存档权限分配（管理）（公共）", response = OkrResult.class)
    public OkrResult<BffArchiveTributPowerComRespDto> archiveTributPowerCom(@RequestBody(required = false) @Validated BffArchiveTributPowerComReqDto reqDTO) {
        return OkrResult.success(powerService.archiveTributPowerCom(reqDTO));
    }

    /**
     * B1-2存档部门权限分配（管理）
     * gen by moon at 10/15/2022, 5:53:23 PM
     */
    @PostMapping("/oms/mgt/power/archiveTribuDeptPower")
    @ApiOperation(value = "B1-2存档部门权限分配（管理）", response = OkrResult.class)
    public OkrResult<BffArchiveTribuDeptPowerRespDto> archiveTribuDeptPower(@RequestBody(required = false) @Validated BffArchiveTribuDeptPowerReqDto reqDTO) {
        return OkrResult.success(powerService.archiveTribuDeptPower(reqDTO));
    }

    /**
     * B1-2查询权限分配列表（管理边界）
     * gen by moon at 10/23/2022, 2:36:40 PM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerListBorder")
    @ApiOperation(value = "B1-2查询权限分配列表（管理边界）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerListBorderRespDto> queryTributPowerListBorder(@RequestBody(required = false) @Validated BffQueryTributPowerListBorderReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerListBorder(reqDTO));
    }

    /**
     * B1-2查询分配的部门权限列表（管理）
     * gen by moon at 8/22/2022, 10:22:52 PM
     */
    @PostMapping("/oms/mgt/power/queryTribuDeptPowerList")
    @ApiOperation(value = "B1-2查询分配的部门权限列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTribuDeptPowerListRespDto> queryTribuDeptPowerList(@RequestBody(required = false) @Validated BffQueryTribuDeptPowerListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTribuDeptPowerList(reqDTO));
    }

    /**
     * B1-2查询权限分配详情(管理)
     * gen by moon at 8/10/2022, 3:32:50 AM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerDetail")
    @ApiOperation(value = "B1-2查询权限分配详情(管理)", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerDetailRespDto> queryTributPowerDetail(@RequestBody(required = false) @Validated BffQueryTributPowerDetailReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerDetail(reqDTO));
    }

    /**
     * B1-2查询权限分配的部门职务列表（管理）
     * gen by moon at 8/10/2022, 3:32:46 AM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerDeptPositionList")
    @ApiOperation(value = "B1-2查询权限分配的部门职务列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerDeptPositionListRespDto> queryTributPowerDeptPositionList(@RequestBody(required = false) @Validated BffQueryTributPowerDeptPositionListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerDeptPositionList(reqDTO));
    }

    /**
     * B1-2查询权限分配的部门成员列表（管理）
     * gen by moon at 8/22/2022, 10:22:51 PM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerInductionRecordList")
    @ApiOperation(value = "B1-2查询权限分配的部门成员列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerInductionRecordListRespDto> queryTributPowerInductionRecordList(@RequestBody(required = false) @Validated BffQueryTributPowerInductionRecordListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerInductionRecordList(reqDTO));
    }

    /**
     * B1-2查询权限分配的员工列表（管理）
     * gen by moon at 10/23/2022, 12:09:09 AM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerMemberList")
    @ApiOperation(value = "B1-2查询权限分配的员工列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerMemberListRespDto> queryTributPowerMemberList(@RequestBody(required = false) @Validated BffQueryTributPowerMemberListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerMemberList(reqDTO));
    }

    /**
     * B1-2查询权限分配的职务列表（管理）
     * gen by moon at 10/23/2022, 12:09:07 AM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerPositionList")
    @ApiOperation(value = "B1-2查询权限分配的职务列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerPositionListRespDto> queryTributPowerPositionList(@RequestBody(required = false) @Validated BffQueryTributPowerPositionListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerPositionList(reqDTO));
    }

    /**
     * B1-2查询权限分配列表（管理）
     * gen by moon at 8/24/2022, 9:19:09 PM
     */
    @PostMapping("/oms/mgt/power/queryTributPowerList")
    @ApiOperation(value = "B1-2查询权限分配列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryTributPowerListRespDto> queryTributPowerList(@RequestBody(required = false) @Validated BffQueryTributPowerListReqDto reqDTO) {
        return OkrResult.success(powerService.queryTributPowerList(reqDTO));
    }

    /**
     * B1-2新增权限分配（管理）
     * gen by moon at 8/24/2022, 10:43:58 PM
     */
    @PostMapping("/oms/mgt/power/addTributPower")
    @ApiOperation(value = "B1-2新增权限分配（管理）", response = OkrResult.class)
    public OkrResult<BffAddTributPowerRespDto> addTributPower(@RequestBody(required = false) @Validated BffAddTributPowerReqDto reqDTO) {
        return OkrResult.success(powerService.addTributPower(reqDTO));
    }

    /**
     * B1-2查询权限分配的部门列表（管理）
     * gen by moon at 10/23/2022, 12:09:04 AM
     */
    @PostMapping("/oms/mgt/power/queryDeptTributPowerList")
    @ApiOperation(value = "B1-2查询权限分配的部门列表（管理）", response = OkrResult.class)
    public OkrResult<BffQueryDeptTributPowerListRespDto> queryDeptTributPowerList(@RequestBody(required = false) @Validated BffQueryDeptTributPowerListReqDto reqDTO) {
        return OkrResult.success(powerService.queryDeptTributPowerList(reqDTO));
    }

    /**
     * B1-2查询权限详情（管理）
     * gen by moon at 8/10/2022, 3:32:10 AM
     */
    @PostMapping("/oms/mgt/power/queryPowerDetail")
    @ApiOperation(value = "B1-2查询权限详情（管理）", response = OkrResult.class)
    public OkrResult<BffQueryPowerDetailRespDto> queryPowerDetail(@RequestBody(required = false) @Validated BffQueryPowerDetailReqDto reqDTO) {
        return OkrResult.success(powerService.queryPowerDetail(reqDTO));
    }

    /**
     * B1-2-14删除管理的部门(管理)
     * gen by moon at 9/16/2022, 5:19:37 AM
     */
    @PostMapping("/oms/mgt/power/deleteManageDept")
    @ApiOperation(value = "B1-2-14删除管理的部门(管理)", response = OkrResult.class)
    public OkrResult<BffDeleteManageDeptRespDto> deleteManageDept(@RequestBody(required = false) @Validated BffDeleteManageDeptReqDto reqDTO) {
        return OkrResult.success(powerService.deleteManageDept(reqDTO));
    }

    /**
     * B1-2判断权限分配可用
     * gen by moon at 9/17/2022, 8:08:46 AM
     */
    @PostMapping("/oms/power/judgeTributPowerUsable")
    @ApiOperation(value = "B1-2判断权限分配可用", response = OkrResult.class)
    public OkrResult<BffJudgeTributPowerUsableRespDto> judgeTributPowerUsable(@RequestBody(required = false) @Validated BffJudgeTributPowerUsableReqDto reqDTO) {
        return OkrResult.success(powerService.judgeTributPowerUsable(reqDTO));
    }

    /**
     * B1查询一级部门下分配权限人员列表(管理)
     * gen by moon at 11/7/2022, 7:36:10 PM
     */
    @PostMapping("/oms/mgt/power/queryOneDeptTributPowerStaffList")
    @ApiOperation(value = "B1查询一级部门下分配权限人员列表(管理)", response = OkrResult.class)
    public OkrResult<BffQueryOneDeptTributPowerStaffListRespDto> queryOneDeptTributPowerStaffList(@RequestBody(required = false) @Validated BffQueryOneDeptTributPowerStaffListReqDto reqDTO) {
        return OkrResult.success(powerService.queryOneDeptTributPowerStaffList(reqDTO));
    }

    /**
     * B1-2查询当前员工角色权限列表
     * gen by moon at 1/19/2023, 4:23:18 AM
     */
    @PostMapping("/oms/power/queryCurrentStaffRolePowerList")
    @ApiOperation(value = "B1-2查询当前员工角色权限列表", response = OkrResult.class)
    public OkrResult<BffQueryCurrentStaffRolePowerListRespDto> queryCurrentStaffRolePowerList(@RequestBody(required = false) @Validated BffQueryCurrentStaffRolePowerListReqDto reqDTO) {
        return OkrResult.success(powerService.queryCurrentStaffRolePowerList(reqDTO));
    }

    /**
     * B1查询当前用户就职记录权限
     * gen by moon at 6/28/2023, 8:47:31 PM
     */
    @PostMapping("/oms/power/queryCurrentUserRecordTributPowerDetail")
    @ApiOperation(value = "B1查询当前用户就职记录权限", response = OkrResult.class)
    public OkrResult<BffQueryCurrentUserRecordTributPowerDetailRespDto> queryCurrentUserRecordTributPowerDetail(@RequestBody(required = false) @Validated BffQueryCurrentUserRecordTributPowerDetailReqDto reqDTO) {
        return OkrResult.success(powerService.queryCurrentUserRecordTributPowerDetail(reqDTO));
    }


}
